package com.lixin.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class AppConfig {

    @Bean
    @LoadBalanced // 启用负载均衡(ribbon)，默认是轮询算法
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }

}
